﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Huirui.Cavan.Presentation.Seedwork;
using Huirui.Cavan.Domain.MainBoundedContext.StockModule;
using Huirui.Cavan.Domain.MainBoundedContext.SearchModule;
using System.Web.Mvc;
using Huirui.Cavan.Domain.MainBoundedContext.ReportModule;

namespace Huirui.Cavan.Presentation.ViewModel.StockModule
{
    public class StockViewModel : EntityModel<Stock, string, StockSearch>, IStockViewModel
    {
        public IList<SelectListItem> StockTypes { get; set; }
        public IList<SelectListItem> WareHouses { get; set; }
        public IList<SelectListItem> StockUnitsForFrom { get; set; }
        public IList<SelectListItem> StockUnitsForTo { get; set; }
        public string Purpose { get; set; }
        public string SearchFormID { get; set; }
        public string NoPrefixId { get; set; }

        public StockViewModel()
        {
            this.StockTypes = new List<SelectListItem>();
            this.WareHouses = new List<SelectListItem>();
            this.StockUnitsForFrom = new List<SelectListItem>();
            this.StockUnitsForTo = new List<SelectListItem>();
        }
    }

    public class StockJson : BaseJson<string>
    {
        public bool IsSelected { get; set; }
        public string Type { get; set; }
        public string Name { get; set; }
        public string BarCode { get; set; }
        public string Specification { get; set; }
        public string UnitTransfer { get; set; }
        public string StandardPurchasePrice { get; set; }
        public string StandardSalesPrice { get; set; }
        public decimal DiscountRate { get; set; }
        public decimal SalesCost { get; set; }
        public decimal LeftNumber { get; set; }
        public decimal AssistantNumber { get; set; }
        public string Nature { get; set; }
        public decimal FromNumber { get; set; }
        public decimal ToNumber { get; set; }
        public string StockUnit { get; set; }
    }

    public class StockJsonViewModel : JsonViewModel<StockJson>
    {

    }

    public class StockByPurchaseOrderJsonViewModel : JsonViewModel<StockByPurchaseOrderReport>
    {
    }

    public class StockByPurchaseJsonViewModel : JsonViewModel<StockByPurchaseReport>
    {
        public string Purchases { get; set; }
    }

    public class StockBySalesOrderJsonViewModel : JsonViewModel<StockBySalesOrderReport>
    {
        public string SalesOrders { get; set; }
    }

    public class StockBySalesJsonViewModel : JsonViewModel<StockBySalesReport>
    {
        public string Sales { get; set; }
    }
}
